fix: include netcoredbg-bridge-core.js in npm bundle and correct resolver path#79
Merged
Conversation
…t resolver path (#72) Two layered bugs caused the .NET adapter to ship broken in npm 0.19.0/0.20.0: 1. bundle-cli.js only copied netcoredbg-bridge.js by name, omitting its runtime ESM peer netcoredbg-bridge-core.js (which the spawned bridge process imports). tsup inlines into cli.mjs only; the bridge runs as a separate Node child, so the core file must exist on disk next to the entry. Switch to a recursive .js copy of dist/utils/, matching the convention used for the js-debug and CodeLLDB vendor directories. 2. DotnetDebugAdapter's bundled-NPX candidate path used '..' to resolve out of dist/, but the bundle copies the bridge *inside* dist/. Drop the stray '..' so the path matches the actual bundled layout. Also extend test-bundle.cjs to assert netcoredbg-bridge-core.js is in the bundle, closing the test gap that allowed this to ship. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #72 — the .NET adapter was broken in published
@debugmcp/mcp-debugger@0.19.0and0.20.0.list_supported_languagesreported the adapter asinstalled: true, butattach_to_processfailed.Two layered bugs, plus the test gap that let this ship:
netcoredbg-bridge.jsby name but missed its runtime ESM peernetcoredbg-bridge-core.js. tsup inlines intocli.mjsonly; the bridge runs as a separate Node child process, so the core file must exist on disk next to the entry. Switched to a recursive.jscopy ofdist/utils/, matching the convention already used for the js-debug and CodeLLDB vendor directories...that resolved out ofdist/, but the bundle puts the bridge insidedist/. Dropped the..so the path matches the actual bundled layout.netcoredbg-bridge-core.js, so a future broken publish fails the smoke test.The reproduction described in #72 was confirmed locally on the pre-fix tarball (only
netcoredbg-bridge.jsshipped) and verified to be fully resolved on the post-fix tarball (all three util files present, resolver path matches the bundled location).Test plan
pnpm --filter @debugmcp/mcp-debugger run buildproduces a tarball containing bothnetcoredbg-bridge.jsandnetcoredbg-bridge-core.jsunderpackage/dist/packages/adapter-dotnet/dist/utils/npx vitest run packages/adapter-dotnet/tests/unit/dotnet-bridge-fallback.test.ts— 3/3 passnpm test— 2308/2309 pass locally (one unrelated Rust e2e failure caused by a local Windows toolchain DLL init issue; CI onmainis green)testpublishedskill)🤖 Generated with Claude Code